#pragma once

#include "iNetMessageHandler.h"
#include "UDPSocket.h"
#include <list>

namespace _FOGGE_
{
	namespace _UTIL_
	{
		class FileTransferAgent :
			public _FOGGE_::_NET_::iNetMessageHandler
		{
			struct FileTransferInfo
			{
				FILE* hFIle;
				DWORD dwSize;
				DWORD dwFragmentSize;//*file fragment size*/
				DWORD dwFragmentCount;//* file fragment count*/
				DWORD dwProcessCount;// receive or send count  processing is complete when dwProcessCount==dwFragmentCount*/
				bool bIsSending;
				unsigned char ucPeerIndex;
			};
		public:
			void AddPeer();
			FileTransferAgent(void);
			~FileTransferAgent(void);
			
			
		protected:
			_FOGGE_::_NET_::UDPSocket m_UdpSocket;
		protected:
			std::list<FileTransferInfo*> m_FileTransferInfoList;
		};
	}
}